A masking effect, which is a phenomenon in psychoacoustics, occurs when quiet signals that are adjacent to loud signals are masked by the loud signals, thereby causing the quiet signals to be imperceptible to the human auditory system. If a quantization error, which is generated when an audio signal is quantized, is below a masking threshold, a listener may not hear quantization noise.
When encoding an audio signal, a basic unit of encoding, i.e., a frame, needs to be short in order to ensure a short latency time. However, the frame needs to be enough long to ensure a high spectral resolution for high quality of sound. Therefore, it is difficult to simultaneously ensure a short latency time and high quality of sound.
In psychoacoustics, when the frame is short, that is, when a masking threshold is calculated by using a short window, the masking threshold may be greater than a masking threshold that is calculated by using a long window. Therefore, when the audio signal is encoded based on the masking threshold that is calculated by using the short window, more quantization noise may flow in, and thus reduce quality of sound.